<?php

namespace app\admin\model\test\zym;

use think\Model;

class Subject extends Model
{
    // 表名
    protected $name = 'test_zym_subject';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    // 定义时间戳字段名
    protected $createTime = false;
    protected $updateTime = false;
    
    // 追加属性
    protected $append = [

    ];

    public function getCateIdAttr($v,$d){
        $cates = (new \app\admin\model\test\zym\Cate()) -> select();
        $cs = [];
        foreach ($cates as $k => $val){
            $cs[$val['id']] = $val['name'];
        }
        return $cs[$v];
    }
    
    public function getAAttr($v){
        return '从不';
    }

    public function getBAttr($v){
        return '偶尔';
    }

    public function getCAttr($v){
        return '有时';
    }

    public function getDAttr($v){
        return '经常';
    }

    public function getEAttr($v){
        return '频繁';
    }

    public function getFAttr($v){
        return '总是';
    }






}
